Image processing apparatus and control method therefor

ABSTRACT

An image processing apparatus according to the present invention comprises: an acquisition unit that acquires a statistical value of pixel values for each divided region; a determination unit that compares for each divided region the statistical value of the divided region acquired by the acquisition unit with a first threshold and determines whether the divided region is as color region or a monochrome region; and a re-determination unit that compares a statistical value of an adjacent divided region with a second threshold, by which a divided region is more likely determined as a color region than by the first threshold, for each adjacent divided region, and re-determines whether the adjacent divided region is a color region or a monochrome region.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a divisional of application Ser. No. 13/797,080,filed Mar. 12, 2013, the entire disclosure of which is herebyincorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing apparatus and acontrol method therefor.

2. Description of the Related Art

An image processing apparatus in which an input image is divided into amonochrome region (region of a monochrome image) and a color region(region of a color image) and γ correction is performed separately forthe monochrome region and color region has been suggested. For example,an image processing apparatus has been suggested in which γ correctionstipulated in digital imaging and communication in medicine (DICOM),Part 14 (referred to hereinbelow as “DICOM γ correction”) is implementedwith respect to a monochrome region and γ correction with γ=2.2(referred to hereinbelow as “2.2γ correction”) is implemented withrespect to the color region has been suggested. Where such an imageprocessing apparatus is used, when a monochrome image such as a Roentgenimage and a color image such as an endoscope image are displayed, theDICOM γ correction is performed with respect to the monochrome image,the 2.2γ correction is performed with respect to the color image, andeach image is displayed with adequate gradation.

A method for dividing an input image into a monochrome region and acolor region is disclosed, for example, in Japanese Patent ApplicationPublication No. 2003-244469. More specifically, Japanese PatentApplication Publication No. 2003-244469 discloses a method by which aninput image is divided into a plurality of rectangular blocks and it isdetermined whether a monochrome region or a color region is present ineach rectangular block.

The following issues should be taken into account when determining thepresence of monochrome regions and color regions.

A certain number of color pixels, such as color annotation, can bepresent in a monochrome image (for example, a Roentgen image. However,even though the color pixels are included, the monochrome image shouldbe displayed by implementing the DICOM γ correction. Therefore, when themonochrome region is determined, such a region should be determined as amonochrome region even when a certain number of color pixels are presenttherein.

However, when the technique disclosed in Japanese Patent ApplicationPublication No. 2003-244469 is used by taking the aforementioned issueinto account, the following tradeoff situation sometimes occurs. Thus,where either of the monochrome region and color region is determinedcorrectly, the other one is determined erroneously.

This tradeoff will be explained below with reference to FIGS. 12A to12D. FIG. 12A shows an example of an input image. A “color region A” isa rectangular block of a color image (endoscope image) and should bedetermined as a color region. A “monochrome region B” is a rectangularblock of a monochrome image (Roentgen image) and should be determined asa monochrome image. FIG. 12B is an enlarged view of the color region Ashown in FIG. 12A. FIG. 12C is an enlarged view of the monochrome regionB shown in FIG. 12A.

In the color region A and the monochrome region B, the ratio of thenumber of color pixels to the total number of pixels in a rectangularblock is substantially the same. Therefore, when the presence of themonochrome region or color region is determined for each rectangularblock with respect to the image shown in FIG. 12A, the samedetermination result is obtained from the color region A and themonochrome region B. Thus, where the color region A is correctlydetermined as a color region, the monochrome region B is erroneouslydetermined as a color region, and where the monochrome region B iscorrectly determined as a monochrome region, the color region A iserroneously determined as a monochrome region. In FIG. 12D, a zone thatis determined as a color region when the monochrome region B iscorrectly determined as a monochrome region is shown by obliquehatching.

SUMMARY OF THE INVENTION

The present invention provides a technique that inhibits the occurrenceof a tradeoff such that where either of a monochrome region and a colorregion is determined correctly, the other one is determined erroneously.

The present invention in its first aspect provides an image processingapparatus comprising:

an acquisition unit that acquires a statistical value of pixel valuesfor each divided region obtained by dividing an input image;

a determination unit that compares for each divided region thestatistical value of the divided region acquired by the acquisition unitwith a first threshold and determines whether the divided region is ascolor region or a monochrome region; and

a re-determination unit that compares a statistical value of an adjacentdivided region, which is a divided region, from among divided regionsdetermined by the determination unit as monochrome regions, that isadjacent to the divided region determined by the determination unit as acolor region, with a second threshold, by which a divided region is morelikely determined as a color region than by the first threshold, foreach adjacent divided region, and re-determines whether the adjacentdivided region is a color region or a monochrome region.

The present invention in its second aspect provides a control method foran image processing apparatus,

the method comprising:

an acquisition step of acquiring a statistical value of pixel values foreach divided region obtained by dividing an input image;

a determination step of comparing for each divided region thestatistical value of the divided region acquired in the acquisition stepwith a first threshold and determining whether the divided region is acolor region or a monochrome region; and

a re-determination step of comparing a statistical value of an adjacentdivided region, which is a divided region, from among divided regionsdetermined in the determination step as monochrome regions, that isadjacent to the divided region determined in the determination step as acolor region, with a second threshold, by which a divided region is morelikely determined as a color region than by the first threshold, foreach adjacent divided region, and re-determining whether the adjacentdivided region is a color region or a monochrome region.

The present invention in its third aspect provides an image processingapparatus that divides an input image into a color region and amonochrome region,

the apparatus comprising:

an acquisition unit that acquires a statistical value of pixel valuesfor each divided region obtained by dividing the input image;

a division unit that divides the input image into a color region and amonochrome region on the basis of the statistical value for each dividedregion acquired by the acquisition unit; and

a movement unit that moves a boundary between the color region and themonochrome region, which are divided by the division unit, so that theboundary passes inside a boundary proximity region, which is a regionseparated from the boundary by a predetermined distance toward amonochrome region, when a brightness value of the boundary proximityregion is lower than a predetermined value.

The present invention in its fourth aspect provides a control method foran image processing apparatus that divides an input image into a colorregion and a monochrome region,

the control method comprising:

an acquisition step of acquiring a statistical value of pixel values foreach divided region obtained by dividing the input image;

a division step of dividing the input image into a color region and amonochrome region on the basis of the statistical value for each dividedregion acquired in the acquisition step; and

a movement step of moving a boundary between the color region and themonochrome region, which are divided in the division step, so that theboundary passes inside a boundary proximity region, which is a regionseparated from the boundary by a predetermined distance toward amonochrome region, when a brightness value of the boundary proximityregion is lower than a predetermined value.

In accordance with the present invention, the occurrence of a tradeoff,such that where either of a monochrome region and a color region isdetermined correctly, the other one is determined erroneously, can beinhibited.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to Embodiment1;

FIG. 2 illustrates an example of the divided region according toEmbodiment 1;

FIG. 3 is a block diagram illustrating an example of the detailedconfiguration of the threshold calculation unit according to Embodiment1;

FIG. 4 illustrates a specific example of a method for calculating theboundary peripheral region monochrome frequency;

FIGS. 5A and 5B illustrate an example of the effect obtained inEmbodiment 1;

FIG. 6 is a block diagram illustrating an example of the detailedconfiguration of the region detection unit according to Embodiment 1;

FIGS. 7A and 7B illustrate a specific example of processing performed bythe region detection unit according to Embodiment 1;

FIG. 8 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to Embodiment2;

FIG. 9 is a block diagram illustrating an example of the detailedconfiguration of the threshold calculation unit according to Embodiment2;

FIGS. 10A and 10B illustrate an example of a divided region and ahistogram of pixel values of the divided region;

FIGS. 11A and 11B illustrate an example of the effect obtained inEmbodiment 2;

FIGS. 12A to 12D illustrate the problems inherent to the related art;

FIG. 13 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to Embodiments3 and 4;

FIG. 14 is a block diagram illustrating in detail an example of themonochrome/color determination unit according to Embodiments 3 to 5;

FIGS. 15A to 15C illustrate an example of a processing flow of themonochrome/color determination unit according to Embodiments 3 and 5;

FIG. 16 is a block diagram illustrating in detail an example of thebrightness detection unit according to Embodiments 3 and 4;

FIG. 17 illustrates an example of a small divided region according toEmbodiment 3;

FIG. 18 is a block diagram illustrating in detail an example of theregion detection unit according to Embodiments 3 and 4;

FIGS. 19A to 19C illustrate examples of processing flows performed inthe horizontal integration unit and vertical integration unit accordingto Embodiments 3 and 5;

FIGS. 20A and 20B illustrate an example of a processing flow performedin the boundary movement unit according to Embodiment 3;

FIGS. 21A to 21C illustrate an example of a processing flow performed inthe monochrome/color determination unit according to Embodiment 4;

FIG. 22 illustrates an example of the small divided region according toEmbodiment 4;

FIG. 23 illustrates an example of processing results obtained in thehorizontal integration unit according to Embodiment 4;

FIGS. 24A and 24B illustrate an example of a processing flow performedin the boundary movement unit according to Embodiment 4;

FIG. 25 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to Embodiment5;

FIG. 26 is a block diagram illustrating in detail an example of theregion detection unit according to Embodiment 5;

FIG. 27 illustrates an example of boundary proximity regiondetermination processing performed in the boundary movement unitaccording to Embodiment 5;

FIG. 28 is a block diagram illustrating a detailed example of thebrightness detection unit according to Embodiment 5; and

FIG. 29 illustrates an example of processing results obtained in theboundary movement unit according to Embodiment 5.

DESCRIPTION OF THE EMBODIMENTS Embodiment 1

An image processing apparatus and a control method therefor according toEmbodiment 1 of the present invention will be described below.

FIG. 1 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to the presentembodiment. An image processing apparatus 100 according to the presentembodiment has a monochrome frequency detection unit 101, amonochrome/color determination unit 102, a threshold calculation unit103, a monochrome/color re-determination unit 104, a region detectionunit 105, and a γ correction unit 106. In the image processing apparatusaccording to the present embodiment, image data s0 (input image) isinputted from a personal computer (not shown in the figure). Further,the image processing apparatus according to the present embodimentgenerates image data s1 by performing γ correction with respect to theimage data s0 and outputs the generated image data to a display panel(not shown in the figure). As a result, an image based on the image datas1 can be displayed on the display panel. In the present embodiment,image data s0, s1 are assumed to be RGB data.

The display panel may be part of the image processing apparatus or maybe an apparatus separate from the image processing apparatus.

Further, the image data are not necessarily the RGB data. For example,the image data may be YCbCr data.

The monochrome frequency detection unit 101 acquires the statisticalvalue of pixel values for each divided region obtained by dividing theinput image (image data s0). More specifically, the monochrome frequencydetection unit 101 counts the number (monochrome frequency m0) of themonochrome pixels in a divided region for each divided region. In thepresent embodiment, the monochrome frequency detection unit 101determines a pixel in which an R value, a G value, and a B value are allthe same as a monochrome pixel and counts the monochrome frequency m0.This method for determining whether a pixel is a monochrome pixel is notlimiting. For example, it is also possible to convert RGB data intocolor difference data and determine a pixel with a color differenceequal to zero as a monochrome pixel.

In the present embodiment, as shown in FIG. 2, each of 60 regionsd[0][0] to d[5][9] obtained by dividing the input image into 10 regionsin the horizontal direction and 6 regions in the vertical direction istaken as the abovementioned divided region. Therefore, in the monochromefrequency detection unit 101, a total of 60 monochrome frequencies m0are obtained for the input image of one frame. The monochromefrequencies m0 of the divided regions d[0][0] to d[5][9] are describedas monochrome frequencies m0[0][0] to m0[5][9]. For example, themonochrome frequency m0 of the divided region d[0][0] is described asthe monochrome frequency m0[0][0].

The monochrome frequency detection unit 101 outputs the monochromefrequency m0 for each divided region to the monochrome/colordetermination unit 102, threshold calculation unit 103, andmonochrome/color re-determination unit 104.

In the present embodiment, the statistical value is taken as themonochrome frequency, but the statistical value is not limited thereto.For example, the statistical value may be pixel values of all of thepixels including monochrome pixels and color pixels, the number of colorpixels, or a histogram for each pixel value. Essentially, anystatistical value may be used, provided that this value makes itpossible to determine whether the divided region is a monochrome regionor a color region.

Further, in the present embodiment, it is assumed that the statisticalvalue is generated by the monochrome frequency detection unit 101, butthe statistical value may be also inputted (acquired) from the outside.

The number of divided regions is not limited to 60. For example, thenumber of divided regions may be less or greater than 60, for example,30 or 80. The divided regions may be of any size.

The monochrome/color determination unit 102 compares the statisticalvalue (monochrome frequency m0) of a divided region acquired from themonochrome frequency detection unit 101 with a first threshold for eachdivided region to determine whether the divided region is a color regionof a monochrome region. In the present embodiment, the monochrome/colordetermination unit 102 determines that the divided region is amonochrome region when the monochrome frequency m0 is equal to orgreater than a threshold th (first threshold) and determines that thedivided region is a color region when the monochrome frequency is lessthan the threshold th.

The threshold th is a value that is set, for example, so that thedivided region is determined as a monochrome region even if a certainnumber of color pixels are present, with consideration for a colorannotation present in the monochrome image. In the present embodiment,the threshold th is assumed to be determined such that a divided regionfor which the ratio of the monochrome frequency to the total number ofpixels in the divided region is equal to or greater than 95% isdetermined as a monochrome region, and a divided region for which theabovementioned ratio is less than 95% is determined as a color region.For example, where the size of a divided region is 384 pixels in thehorizontal direction by 400 pixels in the vertical direction, thethreshold this 145920 (=384×400×0.95).

The monochrome/color determination unit 102 outputs the determinationresult indicating whether the divided region is a color region or amonochrome region (monochrome/color determination result mc) to thethreshold calculation unit 103. In the case of a monochrome region, themonochrome/color determination result mc=1, and in the case of a colorregion, the monochrome/color determination result mc=0. Themonochrome/color determination results mc for divided regions d[0][0] tod[5][9] are described as monochrome/color determination results mc[0][0]to mc[5][9]. For example, the monochrome/color determination result mcof the divided region d[0][0] is described as the monochrome/colordetermination result mc[0][0].

The threshold calculation unit 103 calculates a second threshold on thebasis of the statistical value (monochrome frequency m0) of pixel valuesof an adjacent divided region and the statistical value of pixel valuesof a peripheral divided region for each adjacent divided region. Theadjacent divided region is a divided region, from among the dividedregions that are determined by the monochrome/color determination unit102 to be monochrome regions, which is adjacent to the divided regiondetermined by the monochrome/color determination unit 102 to be a colorregion. The peripheral divided region is a region, from among thedivided regions that are determined by the monochrome/colordetermination unit 102 to be monochrome regions, which is on theperiphery of the adjacent divided region that is the calculation objectof the second threshold. The second threshold is a threshold by which adivided region is more likely determined as a color region than by thefirst threshold.

In the present embodiment, the threshold calculation unit 103 calculatesthe threshold th_d for all of the divided region. Therefore, in thepresent embodiment, a total of thresholds th_d are obtained. Thethresholds calculated with respect to the adjacent divided regions, fromamong the thresholds th_d calculated by the threshold calculation unit103, correspond to the above-mentioned second thresholds.

The threshold calculation unit 103 outputs the threshold th_d to themonochrome/color re-determination unit 104.

The configuration of the threshold calculation unit 103 is shown ingreater detail in FIG. 3. The threshold calculation unit 103 has anadjacent divided region detection unit 11, a monochrome frequencyaddition unit 12, and a threshold determination unit 13.

The adjacent divided region detection unit 11 detects an adjacentdivided region by using the monochrome/color determination result mc.

The adjacent divided region detection unit 11 then outputs thedetermination result that determines whether the divided region is anadjacent divided region (adjacent divided region determination resultj_b) to the monochrome frequency addition unit 12. The adjacent dividedregion determination results j_b of the divided regions d[0][0] tod[5][9] are described as adjacent divided region determination resultsj_b[0][0] to j_b[5][9]. For example, the adjacent divided regiondetermination result j_b of the divided region d[0][0] is described asthe adjacent divided region determination result j_b[0][0].

In the present embodiment, the adjacent divided region determinationresults j_b are obtained with Formula (1) below. Thus, when the dividedregion is an adjacent divided region, the adjacent divided regiondetermination result j_b is taken to be equal to 1 or 2, and where thedivided region is not the adjacent divided region, the adjacent dividedregion determination result j_b is taken to be equal to 0. Morespecifically, in the case of an adjacent divided region that is adjacentin the horizontal direction to the divided region determined by themonochrome/color determination unit 102 to be a color region, theadjacent divided region determination result j_b is taken to be equalto 1. In the case of an adjacent divided region that is adjacent in thevertical direction to the divided region determined by themonochrome/color determination unit 102 to be a color region, theadjacent divided region determination result j_b is taken to be equal to2. In the present embodiment, in the case of an adjacent divided regionthat is adjacent in the vertical and horizontal directions to thedivided region determined to be a color region, the adjacent dividedregion determination result j_b is taken to be equal to 1.

When mc[Y][X]=1 and mc[Y][X+1]=0,j _(—) b[Y][X]=1.  (1)

When mc[Y][X]=1 and mc[Y][X−1]=0,j _(—) b[Y][X]=1.  (2)

When mc[Y][X]=1 and mc[Y+1][X]=0,j _(—) b[Y][X]=2.  (3)

When mc[Y][X]=1 and mc[Y−1][X]=0,j _(—) b[Y][X]=2.  (4)

When condition (1) or (2) is fulfilled and the condition (3) or (4) isfulfilled, j _(—) b[Y][X]=1.  (5)

In other cases, j _(—) b[Y][X]=0.  (6)

X: position of the divided region in the horizontal direction.

Y: positive of the divided region in the vertical direction.  Formula(1)

The monochrome frequency addition unit 12 calculates the number ofmonochrome pixels in a region obtained by combining the adjacent dividedregion with the peripheral divided region of this adjacent dividedregion for each adjacent divided region from the monochrome frequency m0and the adjacent divided region determination result j_b. Theabovementioned region obtained by combining the adjacent divided regionwith the peripheral divided region is a region of a boundary peripheryof the divided region determined by the monochrome/color determinationunit 102 as a color region and a divided region determined as amonochrome region. Accordingly, in the present embodiment, the regionobtained by combining the adjacent divided region with the peripheraldivided region is described as a boundary peripheral region, and thenumber of monochrome pixels in the boundary peripheral region isdescribed as a boundary peripheral region monochrome frequency d_m.

The monochrome frequency addition unit 12 outputs the boundaryperipheral region monochrome frequency d_m to the thresholddetermination unit 13.

In the present embodiment, the boundary peripheral region monochromefrequency d_m is also determined with respect to the divided regionsother than the adjacent divided regions. More specifically, the boundaryperipheral region monochrome frequency d_m of the divided regions otherthan the adjacent divided regions is taken as 0. The boundary peripheralregion monochrome frequencies d_m of the divided regions d[0][0] tod[5][9] are described as boundary peripheral region monochromefrequencies d_m[0][0] to d_m[5][9]. For example, the boundary peripheralregion monochrome frequency d_m of the divided region d[0][0] isdescribed as a boundary peripheral region monochrome frequencyd_m[0][0].

The monochrome frequency addition unit 12 calculates the boundaryperipheral region monochrome frequencies d_m by Formula (2) below.

[Math. 1]

When j _(—) b[Y][X]=1 and a divided region with mc=1 is adjacent in therightward direction,  (1)

${{{d\_ m}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {m\; {{{0\lbrack Y\rbrack}\left\lbrack {X + i} \right\rbrack}.}}}$When j _(—) b[Y][X]=1 and a divided region with mc=1 is adjacent in theleftward direction,  (2)

${{{d\_ m}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {m\; {{{0\lbrack Y\rbrack}\left\lbrack {X - i} \right\rbrack}.}}}$When j _(—) b[Y][X]=1 and a divided region with mc=1 is not adjacent inthe horizontal direction,  (3)

d _(—) m[Y][X]=m0[Y][X].

When j _(—) b[Y][X]=2 and a divided region with mc=1 is adjacent in thedownward direction,  (4)

${{{d\_ m}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {m\; {{{0\left\lbrack {Y + i} \right\rbrack}\lbrack X\rbrack}.}}}$When j _(—) b[Y][X]=2 and a divided region with mc=1 is adjacent in theupward direction,  (5)

${{{d\_ m}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {m\; {{{0\left\lbrack {Y - i} \right\rbrack}\lbrack X\rbrack}.}}}$When j _(—) b[Y][X]=2 and a divided region with mc=1 is not adjacent inthe vertical direction,  (6)

d _(—) m[Y][X]=m0[Y][X].

When j _(—) b[Y][X]=0,  (7)

d _(—) m[Y][X]=0.

X: position of the divided region in the horizontal direction.

Y: positive of the divided region in the vertical direction.

k: number of divided regions with mc=1 that are continuous with respectto the adjacent divided region.  Formula (2)

A specific example of a method for calculating the boundary peripheralregion monochrome frequency d_m will be explained below with referenceto FIG. 4. In FIG. 4, the regions surrounded by solid lines (thin lines)are the divided regions determined by the monochrome/color determinationunit 102 as monochrome regions, and the regions surrounded by solidlines (thick lines) are the divided regions determined as color regions.

In the divided region d[1][4] shown in FIG. 4, the adjacent dividedregion determination result j_b=1. The divided regions with mc=1 thatare continuous in the horizontal direction with respect to the dividedregion d[1][4] are the divided regions d[1][5] to d[1][9]. In thepresent embodiment, the region in which the divided regions d[1][4] tod[1][9] are combined (the region surrounded by a broken line in FIG. 4)is a boundary peripheral region with respect to the divided regiond[1][4]. The sum total of the monochrome frequencies m0[1][4] tom0[1][9] of the divided regions d[1][4] to d[1][9] is taken as aboundary peripheral region monochrome frequency d_m[1][4] of the dividedregion d[1][4].

Further, in the divided region d[0][2], the adjacent divided regiondetermination result j_b=2. There is no divided region with mc=1 whichis continuous in the vertical direction with respect to the dividedregion d[0][2]. Therefore, the divided region d[0][2] is taken as aboundary peripheral region with respect to the divided region d[0][2].The monochrome frequency m0[0][2] of the divided region d[0][2] is takenas a boundary peripheral region monochrome frequency d_m[0][2] of thedivided region d[0][2].

In the present embodiment, an example is explained in which a boundaryperipheral region monochrome frequency d_m is calculated by taking adivided region continuous in the horizontal or vertical direction withrespect to the adjacent divided region as a peripheral divided region,but the peripheral divided region is not limited to such a selection.The peripheral divided region may be any divided region on the peripheryof the adjacent divided region, from among the divided regionsdetermined by the monochrome/color determination unit 102 to bemonochrome regions. For example, a divided region within a range at apredetermined distance from an adjacent divided region, from among thedivided regions determined by the monochrome/color determination unit102 to be monochrome regions, may be taken as a peripheral dividedregion of the adjacent divided region.

The threshold determination unit 13 calculates for each divided regionthe threshold th_d from the adjacent divided region determination resultj_b and the boundary peripheral region monochrome frequency d_m. Thethreshold determination unit 13 then outputs the threshold th_d to themonochrome/color re-determination unit 104.

In the present embodiment, the threshold th_d (second threshold) iscalculated with respect to the adjacent divided region on the basis ofthe ratio of the number of monochrome pixels to the total number ofpixels in the boundary peripheral region. More specifically, thethreshold th_d is calculated such that the threshold th_d calculatedwhen the ratio is large becomes a threshold by which a divided region ismore likely determined as a color region than by the threshold th_dcalculated when the ratio is small. In the present embodiment, thelarger is the threshold th_d, the more likely it is to determine that adivided region is a color region. Therefore, in the present embodiment,the threshold th_d calculated when the ratio is large is made largerthan the threshold th_d calculated when the ratio is small.

In the present embodiment, the threshold determination unit 13calculates the threshold th_d by Formula (3) below. A constant g1 isdetermined in advance, for example, by the manufacturer or user. Thevalue of the constant g1 may be changed by the user.

When j _(—) b=1 or 2, th _(—) d=th+(d _(—) m/d_all)×(1−th)×g1.  (1)

When j _(—) b=0, th _(—) d=th.  (2)

d_all: total number of pixels in the boundary peripheral region.

g1: constant.  Formula (3)

The monochrome/color re-determination unit 104 compares the statisticalvalue (monochrome frequency m0) of the adjacent divided region with thesecond threshold (threshold th_d) for each adjacent divided region andre-determines whether this adjacent divided region is a color region ora monochrome region. In the present embodiment, the monochrome/colorre-determination unit 104 re-determines whether a divided region is acolor region or a monochrome region with respect to all of the dividedregions. When the monochrome frequency m0 is equal to or greater thanthe threshold th_d, the monochrome/color re-determination unit 104re-determines that the threshold is a monochrome region, and when themonochrome frequency is less than the threshold th_d, themonochrome/color re-determination unit re-determines a color region.

The monochrome/color re-determination unit 104 then outputs the resultsobtained in re-determining whether the divided regions are color regionsor monochrome regions (monochrome/color re-determination results mc_r)to the region detection unit 105. In the case of a monochrome region,the monochrome/color re-determination result mc_r=1, and in the case ofa color region, the monochrome/color re-determination result mc_r=0.

In color images such as medical images, the background pixels are mostlymonochrome pixels. Therefore, it is highly probable that the adjacentdivided region is a divided region erroneously determined as amonochrome region although it is a color region. As mentionedhereinabove, the second threshold is a threshold by which the dividedregion is more likely to determine as a color region than by the firstthreshold. By performing the re-determination by using such a secondthreshold, it is possible to reduce the abovementioned erroneousdetermination.

However, it is also possible that the adjacent divided region is amonochrome region including a certain number of color pixels (colorpixels constituting an annotation or the like). It is highly probablethat such an annotation is present not only in the adjacent dividedregion, but also in the peripheral divided region of the adjacentdivided region. Therefore, when the ratio of the number of monochromepixels to the total number of pixels in the boundary peripheral regionis small, it is highly probable that the adjacent divided region will bea monochrome region including a certain number of color pixels.Meanwhile, when the abovementioned ratio is large, it is highly probablethat the adjacent divided region is a divided region erroneouslydetermined as a monochrome region although it is a color region. In thepresent embodiment, as mentioned hereinabove, the threshold th_dcalculated when the above-mentioned ratio is large is made larger thanthe threshold th_d calculated when the ratio is small. Therefore, theadjacent divided region which is highly probable to be a color regioncan be easily re-determined as a color region. As a result, it ispossible to determine with better accuracy as to whether the adjacentdivided region is a color region or a monochrome region. Morespecifically, the adjacent divided region which is highly probable to bea color region can be re-determined as a color region, and an adjacentdivided region which is highly probable to be a monochrome regionincluding a certain number of color pixels can be re-determined as amonochrome region.

The effect obtained in the present embodiment will be explained below onthe basis of a specific example.

FIG. 5A illustrates an example of an input image. In the example shownin FIG. 5A, in the input image, an endoscope image 150 is arranged onthe left side and a Roentgen image 151 is arranged on the right side.The Roentgen image 151 is a monochrome image (image constituted bypixels with R value=G value=B value). Further, the endoscope image 150is constituted by a foreground section 152 which is a region of theimage picked up by the endoscope and a background section 153 whichincludes other regions. The pixels of the foreground sections 152 areall color pixels, and the pixels of the background section 153 aremonochrome pixels (in the present embodiment, pixels with R value=Gvalue=B value=0). The color image and monochrome image are not limitedto the medical images. For example, the color image may be an image ofan application for displaying an image, an icon, a graphic, or the like.

In this case, where the threshold th is used to determine whether adivided region is a color region or a monochrome image for each dividedregion, the divided region positioned at the end, from among the dividedregions including the foreground section 152, is erroneously determinedas a monochrome region. For example, the divided region d[1][4] shown inFIG. 5B includes color pixels constituting the foreground 152, but sincethe ratio of monochrome pixels is high, this divided region iserroneously determined as a monochrome region.

In the present embodiment, the threshold th_d by which a divided regionis more likely determined as a color region than by the threshold th iscalculated with respect to such a divided region, and whether thedivided region is a color region or a monochrome image is re-determinedusing this threshold th_d. In the example shown in FIG. 5B, the regionin which the divided regions d[1][4] to d[1][9] are combined is taken asa boundary peripheral region for the divided region d[1][4]. Since thedivided regions d[1][5] to d[1][9] do not include color pixels, theratio of the number of color pixels to the total number of pixels in theboundary peripheral region is large. Therefore, it can be determinedthat the divided region d[1][4] is highly probable to be a region thathas been erroneously determined as a monochrome region although it is acolor region, and the threshold th_d of the divided region [1][4] isincreased. As a result, the divided region d[1][4] is correctlyre-determined as a color region.

The region detection unit 105 divides the input image into a colorregion and a monochrome region. More specifically, the region detectionunit 105 determines a color region constituted by a divided region thathas been re-determined as a color region on the basis of themonochrome/color re-determination result mc_r and outputs coordinateinformation po representing the determined color region to the γcorrection unit 106. In the present embodiment, the coordinateinformation po is assumed to include an upper left coordinate (xcoordinate (coordinate in the horizontal direction), y coordinate(coordinate in the vertical direction)) which is a start point of thecolor region and a lower right coordinate (x coordinate, y coordinate)which is the end point.

FIG. 6 is a block diagram illustrating in detail the configuration ofthe region detection unit 105. The region detection unit 105 has ahorizontal integration unit 300 and a vertical integration unit 301.

The horizontal integration unit 300 produces a single color region byintegrating a plurality of color regions (a plurality of divided regionsre-determined as color regions) continuous in the horizontal direction.The horizontal integration unit 300 outputs the coordinate Hs[Y] in thehorizontal direction (x coordinate) of the left end and the x coordinateHe[Y] of the right end of the integrated color region.

The vertical integration unit 301 produces a single color region byintegrating a plurality of color regions (a plurality of divided regionsobtained by integration in the horizontal integration unit 300)continuous in the vertical direction. The vertical integration unit 301outputs coordinate information po representing the upper left coordinateand lower right coordinate of the integrated color region.

A specific example of processing performed by the horizontal integrationunit 300 and the vertical integration unit 301 will be explained belowwith reference to FIGS. 7A and 7B. The divided regions shown by whitecolor in FIGS. 7A and 7B are the divided regions re-determined asmonochrome regions, and the divided regions shown by oblique hatchingare the divided regions re-determined as color regions. In FIGS. 7A and7B, the upper left coordinate of the input image is assumed to be apoint of origin (0, 0), and the lower right coordinate is assumed to be(1919, 1199). Further, the divided region is assumed to have a size of192 pixels in the horizontal direction by 200 pixels in the verticaldirection.

The processing performed by the horizontal integration unit 300 isexplained below.

First, the horizontal integration unit 300 scans the divided regionsd[0][0] to d[0][9] with the position Y=0 in the vertical direction fromleft to right and integrates continuous color regions, provided thatsuch are present. In the example shown in FIG. 7A, no color regions arepresent among the divided regions d[0][0] to d[0][9] and, therefore, nointegration is performed.

Then, the horizontal integration unit 300 scans the divided regionsd[1][0] to d[1][9] with the position Y=1. In the example shown in FIG.7A, the divided regions d[1][0] to d[1][4] are color regions. Therefore,the horizontal integration unit 300 integrates those five dividedregions d[1][0] to d[1][4] to obtain a single color region. The region 1shown by a broken line in FIG. 7A is a color region obtained byintegrating the divided regions d[1][0] to d[1][4]. The x coordinateHs[1] of the left end and the x coordinate He[1] of the right end of thecolor region 1 have the following values.

Hs[1]=0

He[1]=959

In this case, the x coordinate He[1] of the right end equal to 959 isobtained by subtracting 1 from 192×5=960, which is the size of the fivedivided regions in the horizontal direction.

The horizontal integration unit 300 then performs similar processingalso with respect to the divided regions d[2][0] to d[2][9], dividedregions d[3][0] to d[3][9], divided regions d[4][0] to d[4][9], anddivided regions d[5][0] to d[5][9]. As a result, the following valuesare obtained.

Hs[2]=0

He[2]=959

Hs[3]=0

He[3]=959

Hs[4]=0

He[4]=959

Hs[5]=0

He[5]=959

The processing performed in the vertical integration unit 301 isexplained below.

The vertical integration unit 301 integrates the color regionscontinuous in the vertical direction by using the coordinate valuesoutputted from the horizontal integration unit 300.

In the example shown in FIG. 7A, the values of the x coordinates Hs[1]to Hs[5] of the left ends of the color regions outputted from thehorizontal integration unit 300 are equal to each other. Further, thevalues of x coordinates He[1] to He[5] of the right ends of the colorregions are also equal to each other. Therefore, the five color regionsobtained in the horizontal integration unit 300 have equal horizontalpositions and horizontal dimensions and are continuous in the verticaldirection. In the present embodiment, such a plurality of color regionsis integrated into a single color region.

As a result of the processing performed in the vertical integration unit301, a total of 25 divided regions d[1][0] to d[1][4], d[2][0] tod[2][4], d[3][0] to d[3][4], d[4][0] to d[4][4], and d[5][0] to d[5][4],are integrated and a single color region (region 2 shown by a brokenline in FIG. 7B) is obtained.

The vertical integration unit 301 then outputs the coordinateinformation po representing the upper left coordinate and lower rightcoordinate of the integrated color region 2. In the case shown in FIG.7B, the information po is as follows.

po=((upper left x coordinate,upper left y coordinate),(lower right xcoordinate,lower right y coordinate))=((0,200),(959,1199))

The γ correction unit 106 performs individual γ correction with respectto the color regions and monochrome regions on the basis of thecoordinate information po. Since the regions designated by thecoordinate information po are color regions, the 2.2γ correction (γcorrection with γ=2.2) is applied. Other regions are determined asmonochrome regions, and the DICOM γ correction (γ correction stipulatedby digital imaging and communication in medicine (DICOM) Part 14) isapplied.

In the present embodiment, an example is explained in which the imageprocessing performed individually with respect to color regions andmonochrome regions is the γ correction, but this image processing is notlimiting. Thus, the image processing may be lightness adjustmentprocessing or color temperature adjustment processing.

As mentioned hereinabove, in the present embodiment, it is re-determinedwhether the adjacent divided region is a color region or a monochromeregion by using the second threshold by which the divided region is morelikely determined as a color region than by the first threshold. As aresult, a divided region that has been erroneously determined as amonochrome region, although it is a color region, can be correctlyre-determined as a color region, and the occurrence of a tradeoff, suchthat where either of a monochrome region and a color region isdetermined correctly, the other is determined erroneously, can beinhibited.

Further, in the present embodiment, the configuration is used in whichthe second threshold is calculated on the basis of the statistical valueof pixel values in the adjacent divided region and the statistical valueof pixel values in peripheral divided region for each adjacent dividedregion, but such a configuration is not limiting. The second thresholdmay be any threshold, provided that the divided region is more likelydetermined as a color region by using this threshold than the firstthreshold. For example, the value of the second threshold may be sharedamong a plurality of adjacent divided regions. The second threshold mayhave a preset value.

Further, in the present embodiment, the configuration is used in whichthe threshold th_d is calculated with respect to all of the dividedregions and the re-determination is performed with respect to all of thedivided regions, but such a configuration is not limiting. For example,it is possible to calculate the threshold th_d only with respect to theadjacent divided regions and perform the re-determination only withrespect to the adjacent divided regions.

Embodiment 2

An image processing apparatus and a control method therefor according toEmbodiment 2 will be explained below.

FIG. 8 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to the presentembodiment. An image processing apparatus 200 according to the presentembodiment has a histogram detection unit 201, a monochrome/colordetermination unit 102, a threshold calculation unit 203, amonochrome/color re-determination unit 104, a region detection unit 105,and a γ correction unit 106. Functions similar to those of Embodiment 1are assigned with like reference numerals and the explanation thereof isherein omitted.

The histogram detection unit 201 generates (acquires) histograms ofpixel values as a statistical value of pixel values for each dividedregion. In the present embodiment, the histogram detection unit 201generates histograms of brightness values of monochrome pixels(monochrome pixel histogram mhis) for each divided region. Thebrightness value is, for example, an average value of the R value, Gvalue, and B value.

In the present embodiment, similarly to Embodiment 1, each of 60 dividedregions d[0][0] to d[5][9] obtained by dividing the input image by 10 inthe horizontal direction and 6 in the vertical direction is assumed tobe the divided region. The monochrome pixel histograms mhis of thedivided regions d[0][0] to d[5][9] are described as monochrome pixelhistograms mhis[0][0] to mhis[5][9]. The frequency of each brightnessvalue in the monochrome pixel histograms mhis[X][Y] is described asmhis[Y][X][ydata]. For example, the frequency of a monochrome pixel witha brightness value 10 in the divided region d[0][[0] is described asmhis[0][0][10].

The histogram detection unit 201 outputs the total frequency (that is,the monochrome frequency m0) of the monochrome pixel histograms mhis tothe monochrome/color determination unit 102 and outputs the monochromepixel histogram mhis to the threshold calculation unit 203.

In the present embodiment, the brightness value is taken as a 0 to 255gradation value.

A method for determining whether a pixel is a monochrome pixel issimilar to the determination method used in the monochrome frequencydetection unit 101 of Embodiment 1.

The threshold calculation unit 203 calculates the threshold th_d fromthe monochrome pixel histogram mhis and monochrome/color determinationresult ms. The threshold calculation unit 203 outputs the calculatedthreshold th_d to the monochrome/color re-determination unit 104.

The configuration of the threshold calculation unit 203 is shown indetail in FIG. 9. The threshold calculation unit 203 has an adjacentdivided region detection unit 11, a concentrated frequency detectionunit 22, a concentrated frequency addition unit 23, and a thresholddetermination unit 24.

The adjacent divided region detection unit 11 performs the processingsimilar to that of Embodiment 1.

The concentrated frequency detection unit 22 calculates a concentratedfrequency p0 from the monochrome pixel histogram mhis of a dividedregion for each divided region. The concentrated frequency detectionunit 22 then outputs the calculated concentrated frequency p0 to theconcentrated frequency addition unit 23.

The concentrated frequency p0 is the frequency of a gradation value witha concentrated frequency (gradation value for which the frequency ismuch higher than in the surrounding area) in the monochrome pixelhistogram mhis. For example, when the monochrome pixel histogram mhis isthe histogram shown in FIG. 10A, the frequency of the gradation value dis taken as the concentrated frequency p0. The concentrated frequenciesp0 of the divided regions d[0][0] to d[5[[9] is described as theconcentrated frequencies p0[0][0] to p0[5][9]. For example, theconcentrated frequency p0 of the divided region d[0][0] is described asthe concentrated frequency p0[0][0], and the concentrated frequency p0of the divided region d[5][9] is described as the concentrated frequencyp0[5][9].

In the present embodiment, when Formula (4) below is satisfied, thefrequency is determined to be concentrated. A constant gp is determinedin advance, for example, by the manufacturer or user. The value of theconstant gp may be changed by the user.

When ydata=0, mhis[Y][X][ydata]<mhis[Y][X][1]×2×gp.  (1)

When ydata=255, mhis[Y][X][ydata]<mhis[Y][X][254]×2×gp.  (2)

When ydata is other than 0,255,  (3)

mhis[Y][X][ydata]<(mhis[Y][X][ydata−1]+mhis[Y][X][ydata+1]×gp.

X: position of the divided region in the horizontal direction.

Y: position of the divided region in the vertical direction.

gp: constant.  Formula (4)

The concentrated frequency addition unit 23 calculates the concentratedfrequency (boundary peripheral region concentrated frequency d_p) of aboundary peripheral region in which an adjacent divided region and aperipheral divided region of the adjacent divided region are combinedfor each adjacent divided region from the concentrated frequency p0 andthe adjacent divided region determination results j_b. The concentratedfrequency addition unit 23 outputs the boundary peripheral regionconcentrated frequency d_p to the threshold determination unit 24.

In the present embodiment, the boundary peripheral region concentratedfrequency d_p is determined also for divided regions other than theadjacent divided region. More specifically, the boundary peripheralregion concentrated frequency d_p of the divided region other than theadjacent divided region is taken as 0. The boundary peripheral regionconcentrated frequencies d_p of the divided regions d[0][0] to d[5][9]are described as boundary peripheral region concentrated frequenciesd_p[0][0] to d_p[5][9]. For example, the boundary peripheral regionconcentrated frequency d_p of the divided region d[0][0] is described asthe boundary peripheral region concentrated frequency d_p[0][0].

In the present embodiment, the concentrated frequency addition unit 23calculates the boundary peripheral region concentrated frequency d_p byadding up the concentrated frequency p0 of the adjacent divided regionand the concentrated frequency p0 of the peripheral divided region. Morespecifically, the concentrated frequency addition unit 23 calculates theboundary peripheral region concentrated frequency d_p by Formula (5)below.

[Math. 2]

When j _(—) b[Y][X]=1 and a divided region with mc=1 is adjacent in therightward direction,  (1)

${{{d\_ p}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {p\; {{{0\lbrack Y\rbrack}\left\lbrack {X + i} \right\rbrack}.}}}$When j _(—) b[Y][X]=1 and a divided region with mc=1 is adjacent in theleftward direction,  (2)

${{{d\_ p}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {p\; {{{0\lbrack Y\rbrack}\left\lbrack {X - i} \right\rbrack}.}}}$When j _(—) b[Y][X]=1 and a divided region with mc=1 is not adjacent inthe horizontal direction,  (3)

d _(—) p[Y][X]=p0[Y][X].

When j _(—) b[Y][X]=2 and a divided region with mc=1 is adjacent in thedownward direction,  (4)

${{{d\_ p}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {p\; {{{0\left\lbrack {Y + i} \right\rbrack}\lbrack X\rbrack}.}}}$When j _(—) b[Y][X]=2 and a divided region with mc=1 is adjacent in theupward direction,  (5)

${{{d\_ p}\lbrack Y\rbrack}\lbrack X\rbrack} = {\sum\limits_{i = 0}^{k}\; {p\; {{{0\left\lbrack {Y - i} \right\rbrack}\lbrack X\rbrack}.}}}$When j _(—) b[Y][X]=2 and a divided region with mc=1 is not adjacent inthe vertical direction,  (6)

d _(—) p[Y][X]=p0[Y][X].

When j _(—) b[Y][X]=0,  (7)

d _(—) p[Y][X]=0.

X: position of the divided region in the horizontal direction.

Y: positive of the divided region in the vertical direction.

k: number of divided regions with mc=1 that are continuous with respectto the adjacent divided region.  Formula (5)

A specific example of a method for calculating the boundary peripheralregion concentrated frequency d_p is described below. The method forcalculating the boundary peripheral region concentrated frequency d_pinvolves the processing substantially identical to that of the methodfor calculating the boundary peripheral region monochrome frequency d_mof Embodiment 1. Therefore, the explanation thereof is conducted usingFIG. 4.

In the divided region d[1][4], the adjacent divided region determinationresult j_b=1. The divided regions with mc=1 that are continuous in thehorizontal direction with respect to the divided region d[1][4] are thedivided regions d[1][5] to d[1][9]. Therefore, the region in which thedivided regions d[1][4] to d[1][9] are combined is taken as a boundaryperipheral region with respect to the divided region d[1][4]. The sumtotal of the concentrated frequencies p0[1][4] to p0[1][9] of thedivided regions d[1][4] to d[1][9] is taken as a boundary peripheralregion concentrated frequency d_p [1][4].

Further, in the divided region d[0][2], the adjacent divided regiondetermination result j_b=2. There is no divided region with mc=1 whichis continuous in the vertical direction with respect to the dividedregion d[0][2]. Therefore, the divided region d[0][2] is taken as aboundary peripheral region with respect to the divided region d[0][2].The concentrated frequency p0[0][2] of the divided region d[0][2] istaken as a boundary peripheral region concentrated frequency d_p [0][2]of the divided region d[0][2].

The threshold determination unit 24 calculates for each divided regionthe threshold th_d from the adjacent divided region determination resultj_b and the boundary peripheral region concentrated frequency d_p. Thethreshold determination unit 24 then outputs the threshold th_d to themonochrome/color re-determination unit 104.

In the present embodiment, the second threshold is calculated withrespect to the adjacent divided region on the basis of the uniformity ofpixel values (more specifically, brightness values) of the boundaryperipheral region. More specifically, the threshold th_d is calculatedsuch that the threshold th_d calculated when the uniformity is highbecomes a threshold by which a divided region is more likely determinedas a color region than by the threshold th_d calculated when theuniformity is low. In the present embodiment, the larger is thethreshold th_d, the more likely it is to determine that a divided regionis a color region. Therefore, in the present embodiment, the thresholdth_d calculated when the uniformity is high is made larger than thethreshold th_d calculated when the uniformity is low.

A large boundary peripheral region concentrated frequency d_p means thatthe uniformity of pixel values is high. Accordingly, in the presentembodiment, the threshold th_d is calculated on the basis of theboundary peripheral region concentrated frequency d_p so that thethreshold th_d calculated when the d_p is large becomes a threshold bywhich a divided region is more likely determined as a color region thanby the threshold th_d calculated when the d_p is small.

In the present embodiment, the threshold determination unit 24calculates the threshold th_d by Formula (6) below. A constant g2 isdetermined in advance, for example, by the manufacturer or user. Thevalue of the constant g2 may be equal to or different from that of theconstant g1 in Embodiment 1. The value of the constant g2 may be changedby the user.

When j _(—) b=1, th _(—) d=th+(d _(—) p/d_all)×(1−th)×g2.  (1)

When j _(—) b=0, th _(—) d=th.  (2)

d_all: total number of pixels in the boundary peripheral region.

g2: constant.  Formula (6)

In color images such as medical images, the background pixel values aremostly uniform. Therefore, it is highly probable that the adjacentdivided region with a high uniformity of pixel values is a dividedregion erroneously determined as a monochrome region although it is acolor region. More specifically, it is highly probable that the image ofthe adjacent divided region with a high uniformity of pixel values suchas shown in FIG. 10A is the image such as shown in FIG. 10B (the imagethat includes a very small foreground (color pixels) of a color image,with the remaining region being a background (monochrome pixels) of thecolor image). Meanwhile, it is highly probable that the image of theadjacent divided region with a low uniformity of pixel values is amonochrome region including a certain number of color pixels.

The abovementioned background pixels are often included not only intothe divided region that has been erroneously determined as a monochromeregion although it is a color region, but also into the peripheraldivided regions thereof. Therefore, when the uniformity of pixel valuesin the boundary peripheral region is high, the probability of theadjacent divided region being the abovementioned erroneously determineddivided region becomes even higher. Meanwhile, when the uniformity ofpixel values in the boundary peripheral region is low, the probabilityof the adjacent divided region being a monochrome region including acertain number of color pixels becomes even higher.

In the present embodiment, as shown in Formula (6), the threshold th_dis made larger than the threshold th by an amount corresponding to thedegree of the abovementioned uniformity. By performing there-determination by using such a threshold th_d, it is possible todetermine with better accuracy as to whether the adjacent divided regionis a color region or a monochrome region. More specifically, theadjacent divided region which is highly probable to be a color regioncan be re-determined as a color region, and an adjacent divided regionwhich is highly probable to be a monochrome region including a certainnumber of color pixels can be re-determined as a monochrome region.

The effect obtained in the present embodiment will be explained below onthe basis of a specific example.

FIG. 11A illustrates an example of an input image. In the example shownin FIG. 11A, in the input image, an endoscope image 1150 is arranged onthe left side and a Roentgen image 1151 is arranged on the right side.The endoscope image 1150 is constituted by a foreground 1152 and abackground 1153. The Roentgen image 1151 includes color annotation “A”.

In this case, where the threshold th is used to determine whether adivided region is a color region or a monochrome image for each dividedregion shown in FIG. 11B, the divided region d[1][4] including theforeground 1152 of the endoscope image 1150 is correctly determined as acolor region. The divided region d[1][5] adjacent to the divided regiond[1][4] is correctly determined as a monochrome region.

In this case, the divided region d[1][5] is taken as an adjacent dividedregion and where the re-determination is performed by the method similarto that of Embodiment 1, this region is erroneously determined as acolor region.

Meanwhile, in the present embodiment, the divided region d[1][5] can becorrectly determined as a monochrome region. More specifically, in thedivided region d[1][5] (and the divided regions d[1][6] to d[1][9]continuous to the divided region d[1][5]), the uniformity of pixelvalues is low. Therefore, in the present embodiment, the threshold th_dof the divided region d[1][5] is taken to as a value substantially equalto the threshold th. As a result, the divided region d[1][5] can becorrectly re-determined as a monochrome region.

As mentioned hereinabove, in the present embodiment, the secondthreshold is calculated on the basis of the uniformity of pixel valuesin the boundary peripheral region. As a result, a divided region thathas been erroneously determined as a monochrome region, although it is acolor region, can be correctly re-determined as a color region, and theoccurrence of a tradeoff, such that where either of a monochrome regionand a color region is determined correctly, the other is determinederroneously, can be inhibited. For example, when the adjacent dividedregion is a divided region including a certain number of color pixelsand the peripheral divided region thereof is a divided region includingno color pixels, the adjacent divided region can be re-determinedcorrectly as a monochrome region.

Further, in the present embodiment, the configuration is used in whichthe second threshold is calculated on the basis of the uniformity ofpixel values in a region obtained by combining the adjacent dividedregion and the peripheral divided region, but such a configuration isnot limiting. As mentioned hereinabove, an adjacent divided region witha high uniformity of pixel values is highly probable to be a dividedregion erroneously determined as a monochrome region although it is acolor region. Meanwhile, an adjacent divided region with a lowuniformity of pixel values is highly probable to be a monochrome regionincluding a certain number of color pixels. Therefore, the secondthreshold may be also calculated on the basis of uniformity of pixelvalues only of the adjacent divided region.

Further, in the present embodiment, the uniformity of brightness valuesof monochrome pixels is used as the uniformity of pixel values, butuniformity of pixel values is not limited to such selection. Forexample, uniformity of pixel values of color pixels and uniformity ofpixel values of all of the pixels (all of the pixels in the dividedregion) including monochrome pixels and color pixels may be also used.The uniformity of pixel values may also be the uniformity of colordifference signals (Cb value and Cr value).

Embodiment 3

An image processing apparatus and a control method therefor according toEmbodiment 3 will be explained below.

In the image processing apparatus according to the present embodiment,an input image is divided into a color region and a monochrome region,and image processing is performed individually for the color region andmonochrome region. In the present embodiment, the γ correctionstipulated by digital imaging and communication in medicine (DICOM) Part14 (DICOM γ correction) is applied with respect to the monochromeregion, and the γ correction with γ=2.2 (2.2γ correction) is appliedwith respect to the color image.

FIG. 13 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to the presentembodiment. The image processing apparatus according to the presentembodiment has a monochrome/color determination unit 1301, a brightnessdetection unit 1302, a region detection unit 1303, a γ correction unit1304, and a display panel 1305. In the image processing apparatusaccording to the present embodiment, image data s0 (input image) areinputted from a personal computer (not shown in the figure). Further,the image processing apparatus according to the present embodimentgenerates image data s1 by performing γ correction with respect to theimage data s0 and displays the image based on the image data s1 on thedisplay panel 1305. In the present embodiment, image data s0, s1 areassumed to be RGB data.

In the present embodiment, an example is explained in which the displaypanel 1305 is part of the image processing apparatus, but the displaypanel 1305 may be an apparatus separate from the image processingapparatus.

Further, the image data are not necessarily the RGB data. For example,the image data may be YCbCr data.

The monochrome/color determination unit 1301 generates and outputs amonochrome determination signal mc for each divided region (rectangularblock) obtained by dividing the input image (image data s0). Themonochrome determination signal mc indicates whether the correspondingdivided region is a monochrome region or a color region.

FIG. 14 is a block diagram illustrating in detail the monochrome/colordetermination unit 1301. The monochrome/color determination unit 1301 isconstituted by a division coordinate designation unit 1400, a count unit1401, and a determination unit 1402.

FIGS. 15A to 15C illustrate the processing flow in the monochrome/colordetermination unit 1301.

The processing performed in the monochrome/color determination unit 1301is explained below with reference to FIGS. 14 and 15A to 15C.

FIG. 15A illustrates an example of image data s0. In the example shownin FIG. 15A, the image data s0 are data on the image in which anendoscope image 1500 is arranged on the left side and a Roentgen image1501 is arranged on the right side. The Roentgen image 1501 is amonochrome image (image constituted by pixels with R value=G value=Bvalue). Further, the endoscope image 1500 is constituted by a foregroundsection 1502 which is a region of the image picked up by the endoscopeand a background section 1503 which includes other regions. The pixelsof the foreground section 1502 are all color pixels, and the pixels ofthe background section 1503 are pixels with a low brightness value (inthe present embodiment, R value=G value=B value=0). In the presentembodiment, the image size of the image data s0 is 1920 pixels in thehorizontal direction by 1200 pixels in the vertical direction.

The division coordinate designation unit 1400 determines a plurality ofdivided regions and outputs coordinate information representing eachdivided region (division coordinate information b0) to the count unit1401. In the present embodiment, the plurality of divided regions isassumed to include 15 region obtained by dividing the image data s0 intofive regions in the horizontal direction and three regions in thevertical direction. The number of the divided regions is not limited to15. Thus, the number of the divided regions may be greater or less than15, for example, 10 or 20.

FIG. 15B illustrates an example of 15 divided regions A(0, 0) to A(4, 2)determined by the division coordinate designation unit 1400. In thepresent embodiment, the size of the divided region is 384 in thehorizontal direction (=1920 divided by 5) by 400 pixels in the verticaldirection (=1200 divided by 3).

The count unit 1401 acquires the statistical value of pixel values foreach divided region. More specifically, the count unit 1401 counts thenumber (referred to hereinbelow as “monochrome frequency”) of themonochrome pixels in a divided region for each divided region determinedby the division coordinate designation unit 1400 and outputs monochromefrequency data m0 representing the monochrome frequency of each dividedregion. In the present embodiment, the count unit 1401 determines apixel in which an R value, a G value, and a B value are all the same asa monochrome pixel and counts the monochrome frequency. However, thismethod for determining whether a pixel is a monochrome pixel is notlimiting. For example, it is also possible to convert RGB data intobrightness data (Y) and color difference data (Cb, Cr) and determine apixel with a color difference (Cb, Cr) equal to zero as a monochromepixel. The monochrome frequency data m0 are data representing onemonochrome frequency for each divided region. Therefore, in the presentembodiment, the monochrome frequency data m0 are data representing 15monochrome frequencies with respect to the image data s0 of one frame.

Further, in the present embodiment, the statistical value is taken asthe monochrome frequency, but the statistical value is not limitedthereto. For example, the statistical value may be pixel values of allof the pixels including monochrome pixels and color pixels, the numberof color pixels, or a histogram (8 bit: −128 to 127) for each colordifference value (Cb, Cr). Essentially, any statistical value may beused, provided that this value makes it possible to determine whetherthe divided region is a monochrome region or a color region.

The statistical value may be also acquired from the outside.

The determination unit 1402 determines whether the divided region is amonochrome region or a color region for each divided region from themonochrome frequency data m0. Then, the determination unit 1402 outputsa monochrome determination signal mc representing the determinationresult for each divided region. The monochrome determination signal mcis data representing one determination result for each divided region.Therefore, in the present embodiment, the monochrome determinationsignals mc are data representing 15 determination results with respectto the image data s0 of one frame.

In the present embodiment, the determination unit 1402 determines adivided region for which the ratio of the monochrome frequency to thetotal number of pixels in the divided region is equal to or greater than95% as a monochrome region and determines a divided region with thisratio less than 95% as a color region. In this case, the threshold isset to 95%, rather than 100%, in order to determine that the dividedregion is a monochrome region even if a certain number of color pixelsis present therein, with consideration for color annotation in themonochrome image.

In the present embodiment, the size of a divided region is 384 pixels inthe horizontal direction by 400 pixels in the vertical direction.Therefore, the divided region with a monochrome frequency equal to orgreater than 145920 (=384×400×0.95) is determined as a monochrome regionand a divided region with the monochrome frequency less than 145920 isdetermined as a color region.

FIG. 15C illustrates an example of determination results obtained in thedetermination unit 1402. The divided regions shown by white color in thefigure are the divided regions determined as monochrome regions, and thedivided regions shown by oblique hatching are the divided regionsdetermined as color regions. In the five divided regions 1600 surroundedby a broken line in FIG. 15C, color pixels are present in parts of thedivided regions, but the divided regions are determined as monochromeregions. This is because, as mentioned hereinabove, the threshold is setto 95% so that a divided region be determined as a monochrome regioneven if a certain number of color pixels are present therein.

When the DICOM γ correction is applied to the monochrome regions and the2.2γ correction is applied to the color regions in response only to themonochrome determination signal mc, the DICOM γ correction is alsoapplied to the color pixels (pixels of the foreground section 1502)included in the five divided regions 1600. Meanwhile, the 2.2γcorrection is applied to the four divided regions determined as colorregions. As a result, a display brightness step occurs in the foregroundsection 1502 and image quality is degraded (an obstacle is created fromthe standpoint of image quality). More specifically, a step in displaybrightness appears at the boundary of the region determined as amonochrome region and a region determined as a color region.

Accordingly, in the present embodiment, where a region with a lowbrightness (referred to hereinbelow as “low-brightness region”) ispresent in the vicinity of the boundary between the color region andmonochrome region, the boundary is moved so that it passes inside thelow-brightness region. In the low-brightness region, the differencebetween the display brightness observed when the DICOM γ correction isapplied and the display brightness observed when the 2.2γ correction isapplied is small. Therefore, by moving the boundary into thelow-brightness region, it is possible to reduce the degradation ofquality caused by the abovementioned erroneous determination (imagequality obstacle can be reduced). In particular, in color images thatare medical diagnostic images, the background is most often black. Sincethe difference in the display brightness becomes particularly low in theblack region, when the color image is a medical diagnostic image, thepresent invention makes it possible to reduce significantly thedegradation of image quality.

The brightness detection unit 1302 calculates an average brightnessvalue of a small divided region for each of the small divided regionsobtained by dividing the image data s0 to a degree smaller than that ofthe divided regions. The average brightness value is used in thebelow-described region detection unit 1303 to detect a low-brightnessregion.

FIG. 16 is a block diagram illustrating in detail the brightnessdetection unit 1302. The brightness detection unit 1302 is constitutedby a division coordinate designation unit 1601 and an average brightnessdetection unit 1602.

The processing performed by the brightness detection unit 1302 will bedescribed below with reference to FIG. 16.

The division coordinate designation unit 1601 determines a plurality ofsmall divided regions and outputs coordinate information (divisioncoordinate information b1) representing the small divided regions to theaverage brightness detection unit 1602. In the present embodiment, theplurality of small divided regions is 60 regions obtained by dividingthe image data s0 in 10 regions in the horizontal direction and 6regions in the vertical direction. Thus, in the present embodiment, thesmall divided region is obtained by dividing a divided region into 4regions constituting 2 rows and 2 columns. The number of the smalldivided regions may be greater or less than 60, for example, 40 or 80.

FIG. 17 shows an example of 60 small divided regions B(0, 0) to B(9,5)determined by the division coordinate designation unit 1601. In thepresent embodiment, the size of the small divided region is 192 (=1920divided by 10) pixels in the horizontal direction by 200 (=1200 dividedby 6) pixels in the vertical direction. Thus, the size of the smalldivided region in the horizontal direction and vertical direction ishalf that of the divided region.

The average brightness detection unit 1602 detects (calculates) anaverage brightness value of a small divided region for each smalldivided region and outputs average brightness data APL representing theaverage brightness value of each small divided region. In the presentembodiment, an average pixel value is calculated from the R value, Gvalue, and B value of a pixel by using Formula (7) for each pixel in thesmall divided region. The average value of the average pixel values foreach pixel in the small divided region is taken as the averagebrightness value of the small divided region.

Average pixel value=(R value+G value+B value)/3  Formula (7)

The average brightness data APL represent a single average brightnessvalue for each small divided region. Therefore, in the present example,the average brightness data APL represent 60 average brightness valueswith respect to the image data s0 of one frame.

Further, in the present embodiment, the image data s0 (R value, G value,B value) are 8-bit (0 to 255) data, and the average brightness valuesare also assumed to be represented within a range of 0 to 255. Further,in the present embodiment, the brightness detection unit 1302 is assumedto detect average brightness values, but such a configuration is notlimiting. Thus, any information that makes it possible to determinewhether a region is a low-brightness region, such as brightnesshistogram, may be obtained.

The region detection unit 1303 divides the input image into a colorregion and a monochrome region. More specifically, the region detectionunit 1303 determines a color region on the basis of the monochromedetermination signal mc and average brightness data APL, and outputscoordinate information po representing the color region to the γcorrection unit 1304. In the present embodiment, the coordinateinformation po is assumed to include an upper left coordinate (x, y)which is a start point of the color region and a lower right coordinate(x, y) which is the end point. In the present embodiment, the upper leftcoordinate of the image data s0 is the point of origin (0, 0), and thelower right coordinate is (1919, 1199).

The coordinate information po is not limited to the informationincluding the upper left coordinate (x, y) and lower right coordinate(x, y). For example, the coordinate information po may be informationincluding the upper left coordinate (x, y) and the size of the colorregion in the horizontal direction and vertical direction.

FIG. 18 is a block diagram illustrating in detail the region detectionunit 1303. The region detection unit 1303 is constituted by a horizontalintegration unit 1800, a vertical integration unit 1801, and a boundarymovement unit 1802.

The horizontal integration unit 1800 produces a single color region byintegrating a plurality of color regions (a plurality of divided regionsdetermined as color regions) continuous in the horizontal direction. Thehorizontal integration unit 1800 outputs coordinate information H(L)representing the horizontal coordinates (x coordinates) of the left endand right end of the integrated color region (L is a row number).

The vertical integration unit 1801 produces a single color region byintegrating a plurality of color regions (a plurality of divided regionsobtained by integration in the horizontal integration unit 1800)continuous in the vertical direction. The vertical integration unit 1801outputs coordinate information HV representing the upper left coordinateand lower right coordinate of the integrated color region.

Further, in the present embodiment, a region other than the color regionis assumed to be a monochrome region.

As a result of the integration performed by the horizontal integrationunit 1800 and the vertical integration unit 1801, the input image regionis divided into color regions and monochrome regions in the dividedregion units.

However, the present invention is not limited to the feature of dividingthe input image region into color regions and monochrome regions in thedivided region units. In other words, it is not necessary for theboundary between the divided regions determined by the divisioncoordinate designation unit 1400 to match the boundary of the colorregions and monochrome regions. Any method can be used in the presentinvention, provided that the input image is divided into a color regionand a monochrome region. For example, when a threshold such that adivided region is determined as a monochrome region even if a certainnumber of color pixels is present therein is used as a threshold fordetermining whether the divided region is a color region or a monochromeregion, it is highly probable that pixels of the edge section of a colorimage be included in the divided region determined as a monochromeregion. Therefore, the input image may be divided into a color regionand a monochrome region so that the boundary is positioned inside themonochrome divided region (divided region that is determined as amonochrome region) adjacent to the color divided region (divided regiondetermined as a color region).

FIGS. 19A to 19C illustrate a processing flow of the horizontalintegration unit 1800 and the vertical integration unit 1801. Thedivided regions shown by white color in FIGS. 19A to 19C are monochromeregions, and the divided regions shown by oblique hatching are colorregions.

The processing performed by the horizontal integration unit 1800 isexplained below.

First, the horizontal integration unit 1800 scans the divided regionsA(0, 0) to A(4, 0) of the first (leftmost) row from left to right andintegrates continuous color regions, provided that such are present. Inthe example shown in FIG. 19A, no color regions are present among thedivided regions A(0, 0) to A(4,0) and, therefore, no integration isperformed. In the present embodiment, when no color region is present,the coordinate information H (1) has the following value.

H(1)=(x coordinate of the left end, x coordinate of the rightend)=(−1,−1)  Formula (8)

Then, the horizontal integration unit 1800 scans the divided regionsA(0, 1) to A(4, 1) of the second row. In the example shown in FIG. 19A,the divided regions A(0, 1) and A(1, 1) are color regions. Therefore,the horizontal integration unit 1800 integrates those two dividedregions A(0, 1) and A(1, 1) to obtain a single color region. A region320 shown by a dot line in FIG. 19A is a color region obtained byintegrating the divided regions A(0, 1) and A(1, 1). The coordinateinformation H (2) of the integrated color region 320 is as follows.

H(2)=(0,767)  Formula (9)

In this case, the x coordinate of the right end in Formula (9), which isequal to 767, is obtained by subtracting 1 from 384×2=768, which is thesize of the two divided regions in the horizontal direction.

The horizontal integration unit 1800 then performs similar processingalso with respect to the divided regions A(0, 2) to A(4, 2) of the thirdrow. In the example shown in FIG. 19A, the divided regions A(0, 2) andA(1, 2) are color regions. Therefore, the horizontal integration unit1800 integrates those two divided regions A(0, 2) and A(1, 2) to obtaina single color region. A region 321 shown by a dot line in FIG. 19B is acolor region obtained by integrating the divided regions A(0, 2) andA(1, 2). The coordinate information H (3) of the integrated color region321 is as follows.

H(3)=(0,767)  Formula (10)

The processing performed in the vertical integration unit 1801 isexplained below.

The vertical integration unit 1801 integrates the color regionscontinuous in the vertical direction by using the coordinate informationH(1) to H(3) of three types outputted from the horizontal integrationunit 1800.

From H(1), it can be determined that no color regions are present in thefirst row. From H(2) and H(3), it can be determined that the horizontalpositions and horizontal sizes of the color regions in the second andthird rows are the same (H(2)=H(3)). The vertical integration unit 1801integrates a plurality of color regions that thus have the samehorizontal positions and horizontal sizes and are continuous in thevertical direction into a single color region. As a result of theintegration performed by the vertical integration unit 1801, as shown inby a dot line in FIG. 19C, the four divided regions A(0, 1), A(1, 1),A(0, 2), and A(1, 2) are integrated into a single color region 322. Thevertical integration unit 1801 outputs the coordinate information HVrepresenting the upper left coordinate and lower right coordinate of theintegrated color region 322. In the case illustrated by FIG. 19C, thecoordinate information HV is as follows.

HV=((upper left coordinate),(lower rightcoordinate))=((0,400),(767,1199))  Formula (11)

The boundary movement unit 1802 moves the boundary of the color regionand monochrome region divided by the horizontal integration unit 1800and the vertical integration unit 1801 so that the boundary passesinside a boundary proximity region when the brightness value in theboundary proximity region is lower than a predetermined value. Theboundary proximity region is a region separated by a predetermineddistance into the monochrome region from the boundary of the monochromeregion and the color region that are divided by the horizontalintegration unit 1800 and the vertical integration unit 1801.

FIGS. 20A and 20B illustrate the processing flow performed in theboundary movement unit 1802. In FIG. 20A, small divided regions B(0, 0)to B(9, 5) are superimposed on the color region integrated by thevertical integration unit 1801. The region (region that is obliquelyhatched) 322 surrounded by the dot line in FIG. 20A is a color regionintegrated by the vertical integration unit 1801.

In the present embodiment, the boundary movement unit 1802 determineswhether or not the regions separated by a predetermined number of pixelsfrom the color region 322 in the four directions (up, down, left, right)are low-brightness regions (regions with a brightness lower than apredetermined value). When a low-brightness region is present, theboundary movement unit 1802 moves the boundary in this direction.

In the present embodiment, the above-mentioned predetermined number ofpixels is taken as the number of pixels in one small divided region (192pixels in the case of the horizontal direction, and 200 pixels in thecase of the vertical direction). Therefore, in the present embodiment, asmall divided region that is not adjacent to the boundary, from amongthe four small divided regions in the divided region adjacent to theboundary, is taken as a boundary proximity region. The average value Lof the average brightness values of the small divided regions which arethe boundary proximity regions in the four directions (up, down, left,right) is calculated for each of the directions. Where the calculatedaverage value L is less than a predetermined threshold th2, thisboundary proximity region is determined as a low-brightness region. Inthe present embodiment, the predetermined threshold th2 is assumed to be3. However, the threshold th2 is not limited to this value. The value ofthe threshold th2 is set and changed, as appropriate, according to theobject, for example, as to which lightness of the region ensures thatthis region is a low-brightness region.

In the example shown in FIG. 20A, no image is present in the directionleftward and the direction downward of the color region 322. Thereforeno boundary proximity region is set with respect to those twodirections.

Meanwhile, concerning the direction upward of the color region 322, foursmall divided regions B(0, 0) to B(3, 0) located at positions separatedby one small divided region in the direction upward of the upper end ofthe color region 322 are taken as boundary proximity regions. As shownin FIG. 17, since the small divided regions B(0, 0) to B(3, 0) includeonly the pixels of the background 1503, the average brightness values ofthe small divided regions B(0, 0) to B(3, 0) are all 0. Therefore, theaverage value L of the average brightness values of the small dividedregions B(0, 0) to B(3, 0) is zero. Since the average value L (=0) isless than the threshold th2 (=3), the boundary proximity region in thedirection upward of the color region 322 is determined as alow-brightness region.

The reason why a small divided region separated by a predetermineddistance (one small divided region) from a color region is taken as aboundary proximity region in the present embodiment is explained below.It is possible that the average brightness value of the small dividedregions (in the example shown in FIG. 20A, small divided regions B(0, 1)to B(3, 1)) adjacent to the color region includes pixel values of colorpixels (in the present embodiment, the foreground section 1502 shown inFIG. 15A). Therefore, even if a low-brightness region is present in thesmall divided regions adjacent to the color region, the average value Lof such small divided regions is not necessarily equal to or less thanthe threshold th2. Accordingly, in the present embodiment, a smalldivided region separated by the predetermined distance from the colorregion is taken as the boundary proximity region.

Likewise, concerning the direction rightward of the color region 322,four small divided regions B(5, 2) to B(5, 5) located at positionsseparated by one small divided region in the direction rightward of theright end of the color region 322 are taken as boundary proximityregions. As shown in FIG. 17, since the small divided regions B(5, 2) toB(5, 5) include only the pixels of the background 1503, the averagevalue L of the average brightness values of the small divided regionsB(5, 2) to B(5, 5) is zero. Since this average value L is less than thethreshold th2, the boundary proximity region in the direction rightwardof the color region 322 is determined as a low-brightness region.

Further, since the boundary proximity regions in the direction upward ofand to the right from the color region 322 are low-brightness regions,the boundary movement unit 1802 moves the upper boundary and rightboundary of the color region 322 upward and rightward, respectively. Inthe present embodiment, the movement distance of the boundary is 300pixels in either of the horizontal direction and vertical direction.However, this movement distance is not limiting and may be any value,provided that the boundary passes inside the low-brightness region.Further, in the present embodiment, the length of the four boundaries onthe upper, lower, left, and right sides of the color region 322 isadjusted so that the color region is a rectangular region.

Where the boundary is moved, the region (obliquely hatched region) 323surrounded by a dot line in FIG. 20B becomes a final color region. As aresult, the input image is divided into the color region and monochromeregion so as to include the entire foreground section (regionconstituted by color pixels) of the color image.

The boundary movement unit 1802 outputs the coordinate information poindicating the upper left coordinate and lower right coordinate of thecolor region 323. The coordinate information po of the color region 323is as follows.

po=(upper left coordinate,lower rightcoordinate)((0,100),(1067,1199))  Formula (12)

In Formula (12), the x coordinate value=1067 of the lower rightcoordinate is obtained by adding 300 to the horizontal size (384×2) oftwo divided regions and subtracting 1 from the sum obtained.

The γ correction unit 1304 performs the individual γ correction withrespect to the color regions and monochrome regions on the basis of thecoordinate information po. Since the regions designated by thecoordinate information po are color regions, the 2.2γ correction isused. Other regions are determined as monochrome regions, and the DICOMγ correction is used.

As mentioned hereinabove, in the present embodiment, when the boundaryproximity region is a low-brightness region, the boundary of themonochrome region and color region is moved so that this boundary passesinside the low-brightness region. Since the difference in brightnesscaused by the difference in image processing methods is small in thelow-brightness region, the degradation of image quality (brightnessstep) caused by erroneous determination of the color region as amonochrome region can be reduced. In particular, in medical diagnosticimages, the background is most often black. Since the difference inbrightness caused by the difference in image processing methods isespecially small in the black region, the present invention isparticularly effective when the color image is a medical diagnosticimage.

In the present embodiment, the average value L of the average brightnessvalues of a plurality of small divided regions is compared with thethreshold th2 to determine whether or not the plurality of small dividedregions is low-brightness regions, but such a configuration is notlimiting. For example, it is also possible to compare the averagebrightness value of one small divided region, from among the pluralityof small divided regions, with the threshold th2 and determine whetheror not the plurality of small divided regions is low-brightness regions.It is also possible to compare the average brightness value of a smalldivided region with the threshold th2 for each small divided regionwhich is a boundary proximity region and determine whether or not thesmall divided regions are low-brightness regions.

Further, in the present embodiment, a configuration is used in which acolor region is detected by integrating the divided regions determinedas color regions in the horizontal integration unit 1800 and thevertical integration unit 1801, and other regions are taken asmonochrome regions, but such a configuration is not limiting. Forexample, it is also possible to detect a monochrome region byintegrating the divided regions determined as monochrome regions in thehorizontal integration unit 1800 and the vertical integration unit 1801and take other regions as color regions. In another possibleconfiguration, a color region is detected by integrating the dividedregions determined as color regions and detecting a monochrome region byintegrating the divided regions determined as monochrome regions.

In the present embodiment, an example is explained in which the imageprocessing performed individually with respect to color regions andmonochrome regions is the γ correction, but this image processing is notlimiting. Thus, the image processing may be lightness adjustmentprocessing or color temperature adjustment processing.

Further, in the present embodiment, an example is explained in which theboundary proximity region is a region in a divided region adjacent tothe boundary, but such a configuration of the boundary proximity regionis not limiting. Thus, the boundary proximity region may be set furtheron the monochrome region side with respect to the divided regionadjacent to the monochrome region side of the boundary. For example, asmall divided region separated by two small divided regions from theboundary on the monochrome region side may be taken as the boundaryproximity region. The boundary proximity region may be any region thatis separated by a predetermined distance on the monochrome region sidefrom a boundary of the color region and monochrome region divided by thehorizontal integration unit 1800 and the vertical integration unit 1801,and the predetermined distance may have any value. However, from thestandpoint of detecting the background of a color region as alow-brightness region, it is preferred that the boundary proximityregion be a region within a divided region adjacent to the boundary.

Further, in the present embodiment, an example is explained in which asmall divided region is obtained by dividing a divided region into fourregions in 2 rows and 2 columns, but such a small divided region is notlimiting. The small divided region may be a region obtained by evensmaller division of the input image into divided regions. For example,the size of a small divided region is not necessarily an integerfraction of the size of a divided region.

In the present embodiment, an example is explained in which the colorimage and monochrome image are medical images, but such color image andmonochrome image are not limiting. For example, the color image may bean image of an application for displaying an image, an icon, a graphic,or the like.

Embodiment 4

An image processing apparatus and a control method therefor according toEmbodiment 4 of the present invention will be explained below. Thedifference between this embodiment and Embodiment 3 is explained belowin greater detail, and the explanation of functions or features similarto those of Embodiment 3 is herein omitted.

In Embodiment 4, an example of image data s0 is explained that isdifferent from that in Embodiment 3. The image data s0 of the presentembodiment are shown in FIG. 21A. In the image data s0 of the presentembodiment, the shape of a foreground 1502 of an endoscope image 1500 isdifferent from that in Embodiment 3. In aspects other than the shape ofthe foreground 1502, the image data s0 are same as those in Embodiment 3(FIG. 15A).

FIG. 21B illustrates divided regions. In the present embodiment, 15divided regions are set in the same manner as in Embodiment 3.

FIG. 21C illustrates the determination results (results of determiningwhether a divided region is a monochrome region or a color region foreach divided region) obtained by a determination unit 1402.

FIG. 22 illustrates small divided regions. In the present embodiment, 60small divided regions are set in the same manner as in Embodiment 3.

FIG. 23 shows a color region integrated by a horizontal integration unit1800. In the present embodiment, the coordinate information H of a colorregion 350 integrated by the horizontal integration unit 1800 is asfollows.

H(2)=(0,1151)  Formula (13)

The x coordinate=1151 of the right end in Formula (13) is obtained bysubtracting 1 from the horizontal size=384×3=1152 of three dividedregions.

The coordinate information H of a color region 351 is as follows.

H(3)=(0,767)  Formula (14)

In the present embodiment, the coordinate information H of the colorregion 350 does not match that of the color region 351. Therefore, thosetwo color regions are not integrated by the vertical integration unit1801. As a result, the coordinate information HV, which is the output ofthe vertical integration unit 1801, represents the upper left coordinateand lower right coordinate of two color regions as shown hereinbelow.

HV1=((0,400),(1151,799))  Formula (15)

HV2=((0,800),(767,1199))  Formula (16)

Thus, in the present embodiment, a plurality of color regions is setand, therefore, a plurality of boundaries of color regions andmonochrome region is present. In the present embodiment, in such a case,a boundary movement unit 1802 performs the processing of moving theboundary for each boundary. More specifically, in the example shown inFIG. 23, the processing of moving the boundary of the color region 350and the monochrome region and the processing of moving the boundary ofthe color region 351 and the monochrome region are performed. The sameprocedure is used in the case where a plurality of monochrome regions isset in the configuration in which the monochrome regions are detected tomove the boundary.

The processing of moving the boundary of the color region 350 and themonochrome region is explained below.

In the direction upward of the color region 350, a total of six smalldivided regions B(0, 0) to B(5, 0) shown in FIG. 22 are taken asboundary proximity regions. Since the small divided regions B(0, 0) toB(5, 0) include only the pixels of the background 1503, the averagevalue L is zero. Since the average value L is less than the thresholdth2 (=3), the boundary proximity region in the direction upward of thecolor region 350 is determined as a low-brightness region. As a result,the boundary above the color region 350 is moved upward through 300pixels.

Likewise, concerning the direction downward of the color region 350, sixsmall divided regions B(0, 5) to B(5, 5) shown in FIG. 22 are taken asboundary proximity regions. Since the small divided regions B(0, 5) toB(5, 5) include only the pixels of the background 1503, the averagevalue L is zero. Since the average value L is less than the thresholdth2, the boundary proximity region in the direction downward of thecolor region 350 is determined as a low-brightness region. As a result,the boundary below the color region 350 is moved downward through 300pixels.

Concerning the direction rightward of the color region 350, two smalldivided regions B(7, 2) and B(7, 3) shown in FIG. 22 are taken asboundary proximity regions. However, since the small divided regionsB(7, 2) and B(7, 3) include only the pixels of a Roentgen image 1501, asshown in FIG. 22, the average value L is equal to or greater than thethreshold th2, and it is determined that the boundary proximity regionin the direction rightward of the color region 350 is not alow-brightness region. Therefore, the boundary movement unit 1802 doesnot move the boundary on the right side of the color region 350.

Further, since no image is present in the direction leftward of thecolor image 350, the boundary movement unit 1802 does not set a boundaryproximity region in the leftward direction and does not move theboundary on the left side of the color region 350.

FIG. 24A illustrates how the boundary of the color region 350 is movedby the boundary movement unit 1802. As shown in FIG. 24A, the boundarieson the upper side and lower side of the color region 350 are moved bythe boundary movement unit 1802 in the upward and downward directions,respectively, and the color region 350 finally becomes a color region360.

The boundary movement unit 1802 performs similar processing of moving aboundary also with respect to the color region 351. As a result, theboundary of the right side of the color region 351 is moved in therightward direction through 300 pixels. As a consequence, the colorregion 351 becomes a color region 361 as shown in FIG. 24B. Theexamination as to whether or not a low-brightness region is present (bysetting a boundary proximity region, comparing the average value L witha threshold, or the like) may or may not be performed with respect tothe boundary on the upper side of the color region 351 (boundary of thecolor region 350 and color region 351).

The region detection unit 1303 outputs the coordinate information porepresenting the two color regions 360, 361. The γ correction unit 1304applies the 2.2γ correction to the regions represented by the coordinateinformation po. With respect to a region in which the color region 360and the color region 361 overlap, the γ correction is performed suchthat the 2.2γ correction is applied only once (so that the 2.2γcorrection is not applied twice).

As described hereinabove, in accordance with the present embodiment, theprocessing of moving the boundaries is performed when a plurality ofboundaries is present. Therefore, the degradation of image quality (stepin brightness) can be reduced better than when only one boundary ismoved.

Embodiment 5

An image processing apparatus and a control method therefor according toEmbodiment 5 of the present invention will be explained below.

In Embodiments 3 and 4, the feature of setting a plurality of smalldivided regions and selecting a boundary proximity region from among aplurality of small divided regions is used. In the present embodiment,the feature of setting a boundary proximity region, without setting thesmall divided regions, is explained. The difference between thisembodiment and Embodiment 3 is explained below, and the explanation offunctions or features similar to those of Embodiment 3 is hereinomitted.

FIG. 25 is a block diagram illustrating an example of the functionalconfiguration of the image processing apparatus according to the presentembodiment. In the present embodiment, similarly to Embodiments 3 and 4,the image processing apparatus is constituted by a monochrome/colordetermination unit 1301, a brightness detection unit 1302, a regiondetection unit 1303, a γ correction unit 1304, and a display panel 1305.

In the present embodiment, an example of processing the image data s0shown in FIG. 15A is explained.

The monochrome/color determination unit 1301 has functions similar tothose described in Embodiment 3. Therefore, the determination resultsobtained by the monochrome/color determination unit 1301 with respect tothe image data s0 shown in FIG. 15A are those shown in FIG. 15C.

FIG. 26 is a block diagram illustrating in detail the region detectionunit 1303. In the present embodiment, similarly to Embodiment 3, theregion detection unit 1303 is constituted by a horizontal integrationunit 1800, a vertical combination unit 1801, and a boundary movementunit 1802.

The functions of the horizontal integration unit 1800 and the verticalintegration unit 1801 are similar to those described in Embodiment 3.

The boundary movement unit 1802 of the present embodiment determines aboundary proximity region and then outputs coordinate information arrepresenting the boundary proximity region to the brightness detectionunit 1302. The boundary movement unit 1802 then receives averagebrightness data APL representing the average brightness value of theboundary proximity region from the brightness detection unit 1302. Whenthe average brightness value is less than a predetermined threshold th2,the boundary movement unit 1802 determines that the boundary proximityregion is a low-brightness region and moves the boundary so that theboundary passes inside the boundary proximity region.

FIG. 27 illustrates the processing performed by the boundary movementunit 1802 to determine the boundary proximity region (boundary proximityregion determination processing).

The boundary movement unit 1802 inputs coordinate information HV on thecolor regions from the vertical integration unit 1801. The boundarymovement unit 1802 determines a region separated by a predeterminednumber of pixels as a boundary proximity region in each of the fourdirections (up, down, left, right) with respect to the color regionrepresented by the coordinate information HV. In the present embodiment,it is assumed with respect to one direction that a region which is at adistance of 100 pixels from the color region 322 and has a width of 200pixels in this direction is a boundary proximity region.

More specifically, in the case of image data s0 shown in FIG. 15A, tworegions 370, 371 are taken as boundary proximity regions, as shown inFIG. 27. The region 370 is at a distance of 100 pixels from the upperend of the color region 322 and is constituted by 768 pixels in thehorizontal direction by 200 pixels in the vertical direction. The region371 is at a distance of 100 pixels from the right end of the colorregion 322 and is constituted by 200 pixels in the horizontal directionby 800 pixels in the vertical direction. Since no images are present inthe leftward and downward directions of the color region 322, noboundary proximity regions are set. In this case, the coordinateinformation ar represents the regions 370, 371 in the following manner.

ar1=(upper left coordinate of region 370,lower right coordinate ofregion 370)=((0,101),(767,300))  Formula (17)

ar2=(upper left coordinate of region 371,lower right coordinate ofregion 371)=((467,400),(666,800))  Formula (18)

FIG. 28 is a block diagram illustrating in detail the brightnessdetection unit 1302 of the present embodiment.

The brightness detection unit 1302 of the present embodiment isconstituted by an average brightness detection unit 1602.

The image data s0 and the coordinate information ar are inputted to theaverage brightness detection unit 1602. The average brightness detectionunit 1602 detects (calculates) the average brightness value of theregion (boundary proximity region) designated by the coordinateinformation ar. In the case of the image data s0 shown in FIG. 15A, theaverage brightness value for each of the two regions 370, 371 shown inFIG. 27 is detected. The average brightness detection unit 1602 thenoutputs the average brightness data APL representing the two detectedaverage brightness values to the region detection unit 1303.

As mentioned hereinabove, in the boundary movement unit 1802, whether ornot the boundary proximity region is a low-brightness region isdetermined from the average brightness value detected by the averagebrightness detection unit 1602. This determination is the same as thatperformed in Embodiment 3. Since the regions 370, 371 shown in FIG. 27each includes only the pixels of the background section 1503, theaverage brightness values thereof are zero. Therefore, the regions 370,371 are each determined as a low-brightness region, and the boundariesare moved into the regions 370, 371. In the present embodiment, theboundaries are moved through 200 pixels. As a result, the color region320 becomes the region 323 shown in FIG. 29.

As described hereinabove, in accordance with the present embodiment, theboundary proximity region can be set and the effect same as that ofEmbodiments 3 and 4 can be obtained without setting the small dividedregions.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No .2012-081334, filed on Mar. 30, 2012, and Japanese Patent Application No.2012-081336, filed on Mar. 30, 2012, which are hereby incorporated byreference herein in their entirety.

What is claimed is:
 1. An image processing apparatus that divides aninput image into a color region and a monochrome region, the apparatuscomprising: an acquisition unit that acquires a statistical value ofpixel values for each divided region obtained by dividing the inputimage; a division unit that divides the input image into a color regionand a monochrome region on the basis of the statistical value for eachdivided region acquired by the acquisition unit; and a movement unitthat moves a boundary between the color region and the monochromeregion, which are divided by the division unit, so that the boundarypasses inside a boundary proximity region, which is a region separatedfrom the boundary by a predetermined distance toward a monochromeregion, when a brightness value of the boundary proximity region islower than a predetermined value.
 2. The image processing apparatusaccording to claim 1, wherein the boundary proximity region is a regionin a divided region adjacent to the boundary.
 3. The image processingapparatus according to claim 1, wherein the boundary proximity region isa small divided region separated by the predetermined distance from theboundary toward a monochrome region, from among a plurality of smalldivided regions obtained by dividing the input image to a degree smallerthan that of the divided regions.
 4. The image processing apparatusaccording to claim 3, wherein the small divided region is a regionobtained by dividing the divided region into two columns and two rows,which are four regions; and the boundary proximity region is a smalldivided region that is not adjacent to the boundary, from among smalldivided regions in a divided region adjacent to the boundary.
 5. Theimage processing apparatus according to claim 1, wherein when aplurality of boundaries between color regions and monochrome regionsdivided by the division unit are present, the movement unit performsboundary moving processing for each boundary.
 6. A control method for animage processing apparatus that divides an input image into a colorregion and a monochrome region, the control method comprising: anacquisition step of acquiring a statistical value of pixel values foreach divided region obtained by dividing the input image; a divisionstep of dividing the input image into a color region and a monochromeregion on the basis of the statistical value for each divided regionacquired in the acquisition step; and a movement step of moving aboundary between the color region and the monochrome region, which aredivided in the division step, so that the boundary passes inside aboundary proximity region, which is a region separated from the boundaryby a predetermined distance toward a monochrome region, when abrightness value of the boundary proximity region is lower than apredetermined value.